package com.jidu.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jidu.common.utils.DateUtils;
import com.jidu.domain.SysTeacher;
import com.jidu.mapper.SysTeacherMapper;
import com.jidu.service.ISysTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 教师Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-19
 */
@Service
public class SysTeacherServiceImpl  extends ServiceImpl<SysTeacherMapper, SysTeacher> implements ISysTeacherService
{
    @Autowired
    private SysTeacherMapper sysTeacherMapper;

    /**
     * 查询教师
     * 
     * @param id 教师主键
     * @return 教师
     */
    @Override
    public SysTeacher selectSysTeacherById(Long id)
    {
        return sysTeacherMapper.selectSysTeacherById(id);
    }

    /**
     * 查询教师列表
     * 
     * @param sysTeacher 教师
     * @return 教师
     */
    @Override
    public List<SysTeacher> selectSysTeacherList(SysTeacher sysTeacher)
    {
        return sysTeacherMapper.selectSysTeacherList(sysTeacher);
    }

    /**
     * 新增教师
     * 
     * @param sysTeacher 教师
     * @return 结果
     */
    @Override
    public int insertSysTeacher(SysTeacher sysTeacher)
    {
        sysTeacher.setCreateTime(DateUtils.getNowDate());
        sysTeacher.setDelFlag("0");
        sysTeacher.setOrgId(1L);
        sysTeacher.setStatus("0");
        return sysTeacherMapper.insertSysTeacher(sysTeacher);
    }

    /**
     * 修改教师
     * 
     * @param sysTeacher 教师
     * @return 结果
     */
    @Override
    public int updateSysTeacher(SysTeacher sysTeacher)
    {
        sysTeacher.setUpdateTime(DateUtils.getNowDate());
        return sysTeacherMapper.updateSysTeacher(sysTeacher);
    }

    /**
     * 批量删除教师
     * 
     * @param ids 需要删除的教师主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherByIds(Long[] ids)
    {
        return sysTeacherMapper.deleteSysTeacherByIds(ids);
    }

    /**
     * 删除教师信息
     * 
     * @param id 教师主键
     * @return 结果
     */
    @Override
    public int deleteSysTeacherById(Long id)
    {
        return sysTeacherMapper.deleteSysTeacherById(id);
    }
}
